#ifndef GRADIENT_H
#define GRADIENT_H

#include <QGraphicsItem>
#include <QPainter>
#include <QRadialGradient>

class Gradient : public QGraphicsItem
{
public:
     QRectF boundingRect() const
     {
         //qreal penWidth = 1;
         return QRectF(-100, -100,
                       200, 200);
     }

     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
                QWidget *widget)
     {
         //painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
         QPointF         ptCenter(this->boundingRect().center());
         QRadialGradient gradient(ptCenter, this->boundingRect().width() / 2, ptCenter);

         gradient.setColorAt(0, QColor(255, 255, 255, 120));
         //gradient.setColorAt(0.5, Qt::green);
         gradient.setColorAt(1, QColor(255, 255, 255, 10));
         painter->setBrush(gradient);
         painter->drawRect(this->boundingRect());
     }
};

#endif // GRADIENT_H
